\section{Config files}\label{general.configFiles}
GROOPS is controlled by XML configuration files. One or more configuration files
must be passed as arguments to GROOPS:
\begin{verbatim}
  groops config1.xml config2.xml [...]
\end{verbatim}
These files can be created with the graphical user interface program \verb|groopsGui|
in a convenient way (see section~\reference{GUI}{general.gui}).
A complete formal (computer readable) description of a configuration file
in the form of an XSD schema file can be created with the command
\begin{verbatim}
  groops --xsd groops.xsd
\end{verbatim}

A configuration file consists of a list of \reference{programs}{programType}
that are executed in sequential order. Each program comes with its own config options
and they work independently without any internal communication between programs.
Data flow between programs is realized via files. An \config{outputfile} of one program can serve as
an \config{inputfile} for the next program.
Most programs are deliberately kept small and focused on a specific task. This modularity combined with the
general purpose design of many programs enables the creation of complex workflows with little effort.
Including \reference{loops and conditions}{general.loopsAndConditions} in a config file provides even more flexibility.

Individual programs (and also other optional config elements) can be disabled
and are ignored during execution. Mandatory config elements are indicated by a star (\verb|*|).
Empty optional elements are ignored or a meaningful default value is assumed.

The elements of a configuration file can be one of the following basic data types:
\begin{itemize}
\item \verb|int|: integer number
\item \verb|uint|: unsigned integer number
\item \verb|double|: floating point number
\item \verb|angle|: given in degree
\item \verb|time|: given in modified Julian date (MJD)
\item \verb|boolean|: 0: false, 1: true
\item \verb|string|: text
\item \verb|filename|: absolute path to a file or path relative to the working directory
\item \verb|expression|: numerical expression evaluated during execution
\item \verb|doodson|: Doodson number or Darwin's name of a tidal frequency
\item \verb|gnssType|: GNSS observation type according to the RINEX 3 definition
\end{itemize}
The first 5 data types also allow numerical expressions as input in addition to pure numbers.
Next to these basic types there are a number of complex data types called classes,
which are described in section~\reference{Classes}{classes}.

\subsection{Global section}\label{general.configFiles:globalSection}
In addition to programs a config file can also include multiple global elements.
These elements are comparable to read-only global variables in programming and can be referenced from any program.
This can be done by either linking an element directly to a global element or
by using the name of the global element as a variable in an input field (see section~\reference{Parsers and variables}{general.parser}).
While elements can only be directly linked to global elements of the same type, this also supports complex data types
such as \configClass{gravityfield}{gravityfieldType}. Thus it is possible to, for example, define a reference gravity field once
in the global section and use it multiple times in different programs.

One special global element is \verb|groopsDataDir|, which is used as a variable in most default
file paths throughout many GROOPS programs. Since this global element is going to be needed in
most config files, it is recommended to define it in a template file that is used when creating
new config files in the GUI. See section~\reference{Graphical User Interface (GUI)}{general.gui}
for details on how to set up a template file.

It is also possible to import global sections from other config files by providing them as \config{inputfileGlobal}.
Global elements defined in the config file itself overwrite those with the same name imported from other config files.
This functionality allows the definition of a set of global variables in a single file that is then imported into multiple
other config files, which can be useful in larger scenarios/projects.

Global elements can be manipulated when running a config file by passing the argument \verb|--global <name>=<value>|.
For example, running the command
\begin{verbatim}
  groops --global timeStart=58849 --global satellite=swarm config.xml
\end{verbatim}
runs the config file \verb|config.xml| but replaces the values of the global elements \verb|timeStart|
and \verb|satellite| with \verb|58849| and \verb|swarm|, respectively. If a global element passed as
an argument does not already exist in the config file, it will be added with the type \verb|string|.
Only the basic data types listed above are supported. This feature can be useful when running GROOPS
from the command line or from an external script file.
